<template>
  <div class="home-container">
    <!-- 固定顶部导航栏 -->
    <nav class="navbar">
      <div class="navbar-logo">
        <h1>Mini Gateway</h1>
      </div>
      <div class="navbar-links">
        <a href="#">文档</a>
        <a href="#">资源</a>
        <a href="#">下载</a>
        <a href="/controller">控制台</a>
        <a href="#">专家咨询</a>
      </div>
    </nav>

    <!-- 主内容区域（可滚动） -->
    <main class="main-content">
      <!-- 英雄区域 -->
      <section class="hero-section">
        <div class="hero-content">
          <h1>Mini Gateway</h1>
          <p class="description">
            一个更易于构建云原生应用的动态服务发现、配置管理和服务管理平台
          </p>
          <button class="start-btn">快速开始→</button>
        </div>
      </section>

      <!-- 卡片内容区域 -->
      <section class="cards-section">
        <!-- 云原生介绍卡片 -->
        <div class="info-card">
          <div class="card-header">
            <el-icon><Cloudy /></el-icon>
            <h3>云原生安全网关</h3>
          </div>
          <div class="card-content">
            <p>现代化的软件开发和部署方法，充分利用云计算的优点和资源。基于微服务、自动化、DevOps和持续交付等技术，提高应用程序的性能、操作和可靠性。</p>
          </div>
        </div>

        <!-- 核心功能卡片 - 两两一行 -->
        <div class="feature-cards">
          <div class="feature-card">
            <div class="card-icon">
              <el-icon><Lock /></el-icon>
            </div>
            <h4>身份认证与授权</h4>
            <p>通过Auth、JWT实现安全的身份认证与授权机制</p>
          </div>

          <div class="feature-card">
            <div class="card-icon">
              <el-icon><Setting /></el-icon>
            </div>
            <h4>访问控制</h4>
            <p>基于JWT实现细粒度的访问权限控制，类似Spring Security</p>
          </div>

          <div class="feature-card">
            <div class="card-icon">
              <el-icon><Key /></el-icon>
            </div>
            <h4>数据加密</h4>
            <p>传输层TLS加密和应用层AES加密双重保障</p>
          </div>

          <div class="feature-card">
            <div class="card-icon">
              <el-icon><Warning /></el-icon>
            </div>
            <h4>威胁检测</h4>
            <p>防护SQL注入、DDoS等常见网络攻击</p>
          </div>
        </div>

        <!-- 技术栈卡片 -->
        <div class="tech-card">
          <h3>技术栈</h3>
          <div class="tech-tags">
            <span>Spring Boot 3.x</span>
            <span>Spring Cloud Gateway</span>
            <span>Kubernetes</span>
            <span>OPA策略引擎</span>
            <span>Prometheus</span>
            <span>JWT</span>
          </div>
        </div>
      </section>
    </main>

    <!-- 固定底部区域 -->
    <footer class="footer">
      <p>© 2025 Mini Gateway. 版权所有</p>
      <div class="footer-links">
        <a href="#">隐私政策</a>
        <a href="#">服务条款</a>
      </div>
    </footer>
  </div>
</template>

<script setup>
import { Cloudy, Lock, Setting, Key, Warning } from '@element-plus/icons-vue';
</script>

<style scoped>
/* 全局样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Arial', sans-serif;
  overflow-x: hidden;
}

.home-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* 固定顶部导航栏 - 调整透明度 */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: rgba(31, 45, 61, 0.7); /* 添加透明度 */
  padding: 12px 25px;
  color: white;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar-logo h1 {
  font-size: 1.5rem;
  font-weight: bold;
}

.navbar-links a {
  color: white;
  margin: 0 12px;
  text-decoration: none;
  font-size: 0.9rem;
  transition: opacity 0.2s;
}

.navbar-links a:hover {
  opacity: 0.8;
}

/* 主内容区域（可滚动） */
.main-content {
  flex: 1;
  margin-top: 0; /* 去除顶部margin */
  margin-bottom: 60px; /* 为底部留出空间 */
  overflow-y: auto;
}

/* 英雄区域 - 去除与导航栏的间隔 */
.hero-section {
  height: 100vh; /* 使用整个视口高度 */
  min-height: 500px;
  background-image: url('@/assets/imgs/bg2.png');
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-top: 0; /* 确保没有上边距 */
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
}
.hero-content {
  position: relative;
  z-index: 2;
  color: white;
  text-align: center;
  padding: 0 20px;
  max-width: 800px;
}

.hero-content h1 {
  font-size: 2.5rem;
  margin-bottom: 15px;
  font-weight: 600;
}

.description {
  font-size: 1.1rem;
  margin-bottom: 30px;
  line-height: 1.6;
}

.start-btn {
  padding: 12px 28px;
  font-size: 1rem;
  background-color: #1e88e5;
  color: white;
  border: none;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  font-weight: 500;
  letter-spacing: 0.5px;
  margin-bottom: 40px;
}

.start-btn:hover {
  background-color: #1565c0;
  transform: translateY(-2px);
  box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

/* 卡片内容区域 */
.cards-section {
  padding: 60px 20px;
  background-color: #f5f7fa;
  color: #333;
  max-width: 1200px;
  margin: 0 auto;
}

/* 卡片容器样式 */
.info-card,
.feature-cards,
.tech-card {
  margin-bottom: 40px;
}

/* 云原生介绍卡片 */
.info-card {
  background: white;
  border-radius: 12px;
  padding: 30px;
  text-align: left;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.card-header {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
}

.card-header .el-icon {
  font-size: 28px;
  margin-right: 15px;
  color: #1e88e5;
}

.card-header h3 {
  font-size: 1.5rem;
  font-weight: 500;
}

.card-content p {
  line-height: 1.8;
  color: #555;
  font-size: 1.1rem;
}

/* 功能卡片容器 - 两两一行 */
.feature-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* 两列布局 */
  gap: 30px;
  margin-bottom: 60px;
}

/* 单个功能卡片 */
.feature-card {
  background: white;
  border-radius: 12px;
  padding: 30px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.card-icon .el-icon {
  font-size: 40px;
  color: #1e88e5;
  margin-bottom: 20px;
}

.feature-card h4 {
  font-size: 1.2rem;
  margin-bottom: 15px;
  font-weight: 500;
  color: #333;
}

.feature-card p {
  font-size: 1rem;
  color: #666;
  line-height: 1.6;
}

/* 技术栈卡片 */
.tech-card {
  background: white;
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.tech-card h3 {
  font-size: 1.5rem;
  margin-bottom: 20px;
  font-weight: 500;
  color: #333;
}

.tech-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
}

.tech-tags span {
  background: rgba(30, 136, 229, 0.1);
  color: #1e88e5;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
  border: 1px solid rgba(30, 136, 229, 0.3);
}

/* 固定底部区域 */
.footer {
  background-color: rgba(31, 45, 61, 0.9);
  color: white;
  padding: 20px;
  text-align: center;
  font-size: 0.9rem;
  bottom: 0;
  width: 100%;
  z-index: 100;
}

.footer-links {
  margin-top: 10px;
}

.footer-links a {
  color: white;
  margin: 0 10px;
  text-decoration: none;
  transition: opacity 0.2s;
}

.footer-links a:hover {
  opacity: 0.8;
}

/* 响应式调整 */
@media (max-width: 900px) {
  .feature-cards {
    grid-template-columns: 1fr; /* 小屏幕下改为单列 */
  }

  .hero-content h1 {
    font-size: 2rem;
  }

  .description {
    font-size: 1rem;
  }

  .card-header h3,
  .tech-card h3 {
    font-size: 1.3rem;
  }

  .hero-section {
    height: auto;
    padding: 100px 0;
  }
}
</style>